<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="utf-8" />
    <title>Socket.IO Example</title>
  </head>
  <body>
    <h1>Socket.IO Example</h1>
    <h2>How many users are here?</h2>
    <p id="count"></p>
    <script src="/socket.io/socket.io.js"></script>
    <script>
      var socket = io.connect('http://127.0.0.1:3000');
      var count = document.getElementById('count');
      socket.on('users', function (data) {
        console.log('Got udpate from the server');
        console.log('There are ' + data.number + ' users');
        count.innerHTML = data.number
      });
    </script>

  </body>
</html>
